"""
@author: Leo
@version: 1.0.0
@file: serializers.py
@time: 2023/9/17 4:32 PM
"""
from rest_framework import serializers

from lab.common.customize_serializer import FakeModel


class WechatLoginSerializer(serializers.Serializer):
    open_id_code = serializers.CharField()


class WechatLoginWithPhoneNumberSerializer(serializers.Serializer):
    open_id_code = serializers.CharField()
    phone_number_code = serializers.CharField()


class WechatLoginWithPhoneNumberAndVerificationCodeSerializer(serializers.Serializer):
    open_id_code = serializers.CharField()
    phone_number = serializers.CharField()
    verification_code = serializers.CharField()


class SmsSerializer(serializers.ModelSerializer):
    phone_number = serializers.CharField()

    class Meta:
        model = FakeModel
        fields = ('phone_number',)


class MobileLoginSerializer(serializers.ModelSerializer):
    phone_number = serializers.CharField()
    verification_code = serializers.CharField()

    class Meta:
        model = FakeModel
        fields = '__all__'


class WechatQrScanSerializer(serializers.Serializer):
    open_id_code = serializers.CharField()


class WechatQrScanWithPhonenumberAndVerificationCodeSerializer(serializers.Serializer):
    union_id = serializers.CharField()
    phone_number = serializers.CharField()
    verification_code = serializers.CharField()


class OfficialAccountSerializer(serializers.Serializer):
    open_id_code = serializers.CharField()


class OfficialAccountWithPhonenumberAndVerificationCodeSerializer(serializers.Serializer):
    union_id = serializers.CharField()
    phone_number = serializers.CharField()
    verification_code = serializers.CharField()
